<?php
namespace app\admin\controller;
use sand\handle;
/**
* 
*/
class Sand
{
    public function index(){
        
        error_reporting(E_ERROR | E_WARNING | E_PARSE);
        $params = require_once CONF_PATH.'sand/config/params.php';
        $cert = require_once CONF_PATH.'sand/config/cert.php';

        header("Content-type: text/html; charset=utf-8");
        
        $handle = new handle($cert);

        if (isset($_REQUEST['demo'])) {
            $route = $_REQUEST['demo'];
            switch ($route) {
                case 'AgentPay';
                    $handle->execute($params['AgentPay']);
                    break;
                case 'Collection';
                    $handle->execute($params['Collection']);
                    break;
                case 'IdCardVerify';
                    $handle->execute($params['IdCardVerify']);
                    break;
                case 'QueryBalance';
                    $handle->execute($params['QueryBalance']);
                    break;
                case 'QueryFee';
                    $handle->execute($params['QueryFee']);
                    break;
                case 'QueryOrder';
                    $handle->execute($params['QueryOrder']);
                    break;
                case 'RealNameVerify';
                    $handle->execute($params['RealNameVerify']);
                    break;
                default;
                    echo '没有demo:' . $route;
                    break;
            }
        } else {
            echo '缺少参数demo';
        }

    }
}
